<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvas画一个圆</title>
</head>
<body>
    <canvas id="canvas" width="500px" height="500px" style="border: 1px solid #000;"></canvas>
    <script>
        const canvas = document.querySelector('#canvas')
        const ctx = canvas.getContext('2d')
        ctx.fillStyle =  "rgb(200,0,0)";
        ctx.fillRect(10, 10 , 50, 50);
        ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
        ctx.fillRect(30, 30, 55, 50);

        // (x, y, width, height)
        // fillRect 
        // strokeRect
        // clearRect
        ctx.clearRect(30, 30, 30, 30)
        ctx.strokeStyle = '#f00'
        ctx.strokeRect(80, 80, 100, 100)
    </script>
</body>
</html>